#pragma once
#include "order_processor_interfaces.h"
#include "market_data_validator.h"
#include "rate_limiter.h"

class OrderHandlerImpl : public IOrderHandler {
public:
    OrderHandlerImpl(std::shared_ptr<hft::OrderManager> manager,
                   std::unique_ptr<MarketDataValidator> validator,
                   std::unique_ptr<RateLimiter> limiter);

    void processBatch(const std::vector<Order>& orders) override;
    void adjustBatchSize() override;

private:
    std::shared_ptr<hft::OrderManager> manager_;
    std::unique_ptr<MarketDataValidator> validator_;
    std::unique_ptr<RateLimiter> limiter_;
    size_t batchSize_;
    std::chrono::steady_clock::time_point lastBatchTime_;
};